﻿Imports ML.Framework.Collections

Public Class MediaFileCollection(Of T As IMediaFile)
    Inherits SortableCollection(Of T)

    Public Sub New(ByVal isReadonly As Boolean, ByVal Items As IEnumerable(Of T))
        MyBase.New(isReadonly, Items)
    End Sub

    Public Sub New()
        MyBase.New()
    End Sub

    Public Overridable Sub SortByFileSize(Optional ByVal Direction As SortDirection = SortDirection.Asc)
        MyBase.SortBy(New SortCriteria(Of T)(New MediaFileFileSizeComparer, Direction))
    End Sub

    Public Overridable Sub SortByFileType(Optional ByVal Direction As SortDirection = SortDirection.Asc)
        MyBase.SortBy(New SortCriteria(Of T)(New MediaFileFileTypeComparer, Direction))
    End Sub

    Public Overridable Sub ThenSortByFileSize(Optional ByVal Direction As SortDirection = SortDirection.Asc)
        MyBase.ThenSortBy(New SortCriteria(Of T)(New MediaFileFileSizeComparer, Direction))
    End Sub

    Public Overridable Sub ThenSortByFileType(Optional ByVal Direction As SortDirection = SortDirection.Asc)
        MyBase.ThenSortBy(New SortCriteria(Of T)(New MediaFileFileTypeComparer, Direction))
    End Sub

End Class
